package steveshrader.budget.shared;

import java.util.Date;
import java.util.List;

import steveshrader.budget.domain.Expense;
import steveshrader.budget.server.BudgetService;

import com.google.web.bindery.requestfactory.shared.InstanceRequest;
import com.google.web.bindery.requestfactory.shared.LoggingRequest;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.RequestFactory;
import com.google.web.bindery.requestfactory.shared.Service;

/**
 * Request factory...
 * {@link com.google.gwt.core.client.GWT#create}.
 */
public interface BudgetRequestFactory extends RequestFactory {
  /**
   * Source of request objects for the Expense class.
   */
  @Service(Expense.class)
  interface ExpenseRequest extends RequestContext {
    InstanceRequest<ExpenseProxy, Void> persist();
  }

  /**
   * Source of request objects for the BudgetService.
   */
  @Service(BudgetService.class)
  interface BudgetServiceRequest extends RequestContext {
    Request<List<ExpenseProxy>> getExpenses(Date filterStartDate, Date filterEndDate, String filterVendor);
    Request<List<VendorProxy>> getVendors();
    Request<List<ExpenseTypeProxy>> getExpenseTypes();
    Request<List<PaymentTypeProxy>> getPaymentTypes();
    Request<String> deleteExpense(ExpenseProxy expense);
    Request<BudgetUserProxy> getBudgetUser();
    Request<String> getLogoutUrl();
    Request<String> getQuote();
  }

  LoggingRequest loggingRequest();

  ExpenseRequest expenseRequest();
  
  BudgetServiceRequest budgetServiceRequest();
}
